#include "Gauss3DTetra4.h"
#include <cmath>
#include "DataStructure/Common/Real.h"

using SG::DataStructure::Common::Real;
using namespace SG::FEMSolver::Element;

std::size_t SG::FEMSolver::Element::Gauss3DTetra4::nPoint = 4;

Gauss3DTetra4::Gauss3DTetra4 ()
:integPointSet (nPoint)
{
    const Real a{0.13819660112501051517954131656343619};  // (5.0 - sqrt (5.0)) / 20.0
    const Real b{1.0 - 3.0 * a};                          // (5.0 + 3.0 * sqrt (5.0)) / 20.0

    integPointSet[0].m_x      = a;
    integPointSet[0].m_y      = a;
    integPointSet[0].m_z      = a;
    integPointSet[0].m_weight = 0.25;

    integPointSet[1].m_x      = b;
    integPointSet[1].m_y      = a;
    integPointSet[1].m_z      = a;
    integPointSet[1].m_weight = 0.25;

    integPointSet[2].m_x      = a;
    integPointSet[2].m_y      = b;
    integPointSet[2].m_z      = a;
    integPointSet[2].m_weight = 0.25;

    integPointSet[3].m_x      = a;
    integPointSet[3].m_y      = a;
    integPointSet[3].m_z      = b;
    integPointSet[3].m_weight = 0.25;
}